# Maintainer: Muflone http://www.muflone.com/contacts/english/
# Contributor: John D Jones III <j[nospace]n[nospace]b[nospace]e[nospace]k[nospace]1972 -_AT_- the domain name google offers a mail service at ending in dot com>

pkgname=perl-carp-always
_perl_namespace=Carp
_perl_module=Always
pkgver=0.16
pkgrel=4
pkgdesc="Warns and dies noisily with stack backtraces"
arch=('any')
url="https://metacpan.org/release/${_perl_namespace}-${_perl_module}"
license=('PerlArtistic' 'GPL')
depends=('perl')
checkdepends=('perl-test-base')
source=("https://www.cpan.org/modules/by-module/${_perl_namespace}/${_perl_namespace}-${_perl_module}-${pkgver}.tar.gz")
sha512sums=('208e8d8435aebcc8c8345a453d17daaf35976c40e2b91cf528b92e9f6afba81cff9b31b656d71a6736838631e4b110cd12e49cfc48810872d39109b137fa074b')
options=('!emptydirs')

build() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
  perl Makefile.PL
  make
}

check() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  make test
}

package() {
  cd "${_perl_namespace}-${_perl_module}-${pkgver}"
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  make pure_install INSTALLDIRS=vendor DESTDIR="${pkgdir}"
  # Delete unuseful files
  find "${pkgdir}" -name '.packlist' -delete
}
